Circuit and method for driving led lamp with a dimmer

ABSTRACT

A system for driving an LED (light-emitting diode) lamp includes a dimmer circuit coupled to a line input voltage for varying a magnitude of an input voltage and a transformer having a primary winding, a secondary winding, and one or more auxiliary windings, the primary winding coupled to the dimmer circuit. The system also includes an output rectifying circuit coupled to the secondary winding for providing an output current to the LED lamp and a power switch coupled to the primary winding for controlling a current flow in the primary winding. The system further includes a controller having a comparator and a capacitor for providing a control signal to control the power switch for regulating the output current. The controller coupled to the dimmer circuit for receiving an average input voltage signal from the dimmer circuit, wherein the control signal is characterized by a duty cycle that is determined by a ratio of a charging current to a discharging current of the capacitor, and the ratio is related to the average input voltage signal from the dimmer circuit.

CROSS-REFERENCES TO RELATED APPLICATIONS

This application claims the benefit of China Patent Application No.201010273288.1 filed Sep. 2, 2010, commonly owned and incorporated byreference herein which is commonly owned and incorporated by referencein its entirety herein for all purposes.

BACKGROUND OF THE INVENTION

The present invention relates generally to the field of LED lightingsystems. More particularly, embodiments of the present invention relateto circuits and methods for a switching power supply for driving an LEDlighting system.

As energy demand increases, an imbalance exists in the demand and supplyof energy sources. With cost of energy continuing to rise, energy-savinggreen technology is becoming increasingly important. As an example, theenergy consumption in lighting systems can be as high as 20% of thetotal energy consumption. Therefore, energy efficient light systems canhave a big impact in reducing energy consumption.

In particular, LED (light-emitting diode) lamps have the advantages ofhigh efficiency, small volume, and the ability to provide a single lightcolor. As a result, LED lamps have found wide applications in lightingand backlight applications.

The ability to adjust the brightness of a lighting system enables theuser to tailor the lighting system to the need of a particularenvironment that can result in substantial savings in energy costs.Conventional techniques in adjusting the brightness often use a dimmercircuit, which removes either the front portion in the input voltage AC(alternate current) cycle, as in leading-edge dimmers, or the rearportion in the input Ac cycle, as in trailing-edge dimmers.

However, in lighting systems, it has been challenging to control thebrightness of lighting systems based on different light sources. Asdescribed above, LED lamps have many advantages, but without propervoltage supply and precise current control, the efficiency and heatconsumption of an LED lamp can suffer, leading to shortened life time.It is especially changing to use dimmers with an LED lamp.

Therefore, improved brightness control in LED light systems is highlydesirable.

BRIEF SUMMARY OF THE INVENTION

Conventional methods tend to offer limited brightness adjustment range,imprecise current control, and can cause flickers in lighting output. Toovercome these limitations, embodiments of the present invention provideLED lamp driving circuits that have the advantages of wide rangebrightness control, precise current control, and compatibility withvarious dimmer circuits. Some embodiments of the invention have beenapplied to a SMPS (switching mode power supply) controller used in anLED lighting system with a dimmer circuit. In specific embodiments, thecontrol circuit is configured control the current supply to the LED lampby varying the switching frequency and peak current in response to anaverage voltage from a dimmer. But it would be recognized that theinvention has a much broader range of applicability. For example,techniques presented herein can also be used in a fluorescent lightsystem or with a different power supply.

According to an embodiment of the present invention, a control circuitfor providing a pulsed control signal includes an input terminal forreceiving an input voltage, an output terminal for providing a pulsedcontrol signal, a capacitor, and a comparator. The pulsed control signalis characterized by a duty cycle that is determined by a chargingcurrent and a discharging current coupled to the capacitor, the chargingcurrent and the discharging current being related to the input voltage.In an embodiment, the charging current is determined by a differencebetween a first signal and a second signal, and the discharging currentis determined by a sum of the first signal and the second signal. Here,the first signal is derived from the input voltage, and the secondsignal is derived from a first reference signal.

In a specific embodiment, he above control circuit also includes a firstPMOS current mirror coupled to the first signal and a first NMOS currentmirror coupled to the second signal. A first output of the first NMOScurrent mirror is coupled to a first output of the first PMOS currentmirror for providing the difference between the first signal and thesecond signal. A second PMOS current mirror is coupled to a secondoutput of the first NMOS current mirror. An output of the second PMOScurrent mirror is coupled to a second output of the first PMOS currentmirror for producing the sum of the first signal and the second signal.In an embodiment, the duty cycle of the pulsed control signal isdetermined by (I1−I2)/(I1+I2), wherein I1 represents the first signaland I2 represents the second signal.

According to another embodiment of the present invention, a system fordriving an LED (light-emitting diode) lamp includes a dimmer circuitcoupled to a line input voltage for varying a magnitude of an inputvoltage, a transformer having a primary winding, a secondary winding,and one or more auxiliary windings. The primary winding is coupled tothe dimmer circuit. The system also includes an output rectifyingcircuit coupled to the secondary winding for providing an output currentto the LED lamp, and a power switch coupled to the primary winding forcontrolling a current flow in the primary winding. Moreover, the systemincludes a controller having a comparator and a capacitor for providinga control signal to control the power switch for regulating the outputcurrent. The controller is coupled to the dimmer circuit for receivingan average input voltage signal from the dimmer circuit. The controlsignal is characterized by a duty cycle that is determined by a ratio ofa charging current to a discharging current coupled to the capacitor.The ratio is related to the average input voltage signal from the dimmercircuit.

In an embodiment of the system, the charging current is determined by adifference between a first signal and a second signal, and thedischarging current is determined by a sum of a third signal and afourth signal. The first signal and the third signal are derived fromthe average input voltage signal, and the second signal and the fourthsignal are derived from a first reference signal. In another embodiment,the first signal is derived from the average input voltage signalthrough a first current mirror, the third signal is derived from theaverage input voltage signal through a second current mirror, the secondsignal is derived from the first reference signal through a thirdcurrent mirror, and the fourth signal is derived from the firstreference signal through a fourth current mirror. In an embodiment, thecharging current is derived from a fifth current mirror coupled a firstnode coupled to the first signal, and the second signal, and thedischarging current is derived from a sixth current mirror connected tothe third signal and the fourth signal. In a specific embodiment each ofthe first, the second, and the fifth current mirrors comprises PMOStransistors. In an embodiment, each of the third, the fourth, and thesixth current mirrors comprises NMOS transistors.

In an embodiment of the system, the charging current is determined by adifference between a first signal and a second signal, and thedischarging current is determined by a sum of the first signal and thesecond signal. The first signal is derived from the average inputvoltage signal, and the second signal is derived from a first referencesignal. In a specific embodiment, a minimum output current provided tothe LED lamp is about 2% of a maximum output current.

In another embodiment of the system, the controller also includes avoltage follower for receiving the average input voltage signal, asubstractor coupled to the voltage follower, a first current mirrorcoupled to the substractor, a current selector configured for receive acurrent from the first current mirror, and a second current mirrorconfigured to receive a first reference voltage and to provide threereference currents. Two of the reference currents are coupled to thecurrent selector. The current selector is configured to provide twooutput signals. A first output signal is coupled to a peak currentcomparator, and a second output signal is coupled to a constant-currentcontrol circuit for adjusting the ratio of charging and dischargingcurrent.

According to an alternative embodiment of the invention, a drivercircuit for an LED lamp includes a transformer having a primary winding,a secondary winding, and one or more auxiliary windings, a dimmercircuit coupled to a power source and the primary winding, an outputrectifying circuit coupled to the secondary winding for providing anoutput current to the LED lamp, and a controller coupled to the dimmercircuit to receive an average input voltage from the dimmer circuit(DIM). The controller being configured to vary the output currentaccording to the average output voltage.

In a specific embodiment of the above driver circuit, the controller isconfigured to provide an output current Io characterized by thefollowing equations:

${{Ipk} = \frac{Vcs}{Rcs}};$ Ipks = N * Ipk;${{Io} = {{\frac{Tons}{2*{Tsw}}*{Ipks}} = \frac{N*{Tons}*{Vcs}}{2*{Tsw}*{Rcs}}}};$

wherein

-   -   Ipk is the peak primary current,    -   Ipks is the peak secondary current,    -   Vcs is a reference voltage in the controller;    -   Rcs is a resistance of the peak current detection,    -   N is the turn ratio between the primary winding and secondary        winding.

In an embodiment of the driver circuit, the controller includes acurrent control module. The current control module includes:

-   -   a voltage follower for receiving the DIM signal;    -   a substractor coupled to the voltage follower;    -   a first current mirror coupled to the substractor,    -   a current selector configured to receive a current from the        first current mirror; and    -   a second current mirror configured to receive a first reference        voltage and to provide three reference currents, two of the        reference currents being coupled to the current selector,        wherein the current selector are configured to provide two        output signals, a first output signal coupled to a peak current        comparator, a second output signal coupled to a constant-current        control circuit for adjusting a ratio of charging and        discharging.

In an embodiment, the substractor includes a first resistor, a secondresistor, a third resistor, and an operational amplifier, thesubstractor configured to produce a Vdim_in signal cauterized by:

${V\; {dim\_ in}} = {{{VREF}\; 2*\left( {1 + \frac{R\; 305}{R\; 304}} \right)} - {\frac{R\; 305}{R\; 304}*V\; \dim}}$

wherein Vdim is the voltage at the DIM terminal.

In an embodiment, the maximum current selector includes three currentmirrors and is configured received three input currents I1, I2, and I3,with I2=I3, wherein:

-   -   If I1>I2, then the output current=I2, and    -   If I1<I2, then the output current=I1

In an embodiment, when the DIM signal is greater than a referencesignal, the output current of the maximum current selector is set tozero.

A further understanding of the nature and advantages of the presentinvention may be realized by reference to the remaining portions of thespecification and the drawings.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a simplified diagram illustrating a system for driving an LEDlamp according to an embodiment of the present invention;

FIG. 2 is a simplified diagram illustrating a functional block diagramof the controller in the lighting system of FIG. 1 according to anembodiment of the present invention;

FIG. 3 is a simplified diagram illustrating a portion of the controllerfor dimmer control according to an embodiment of the present invention;

FIG. 4 is a simplified circuit diagram illustrating a maximum currentselector circuit in FIG. 3 according to an embodiment of the presentinvention;

FIG. 5 is a simplified circuit diagram illustrating a constant-currentcomparison circuit in FIG. 3 according to an embodiment of the presentinvention; and

FIG. 6 is a simplified flow chart illustrating a method for driving anLED lamp with a dimmer circuit according to an embodiment of the presentinvention.

DETAILED DESCRIPTION OF THE INVENTION

The description below will be with reference to a series of drawingfigures enumerated above. These diagrams are merely examples, and shouldnot unduly limit the scope of the claims herein. In connection with thevarious aspects illustrated and described, one of ordinary skill in theart would recognize other variations, modifications, and alternatives.

FIG. 1 is a simplified diagram illustrating a system 100 for driving anLED lamp according to an embodiment of the present invention. As shownin FIG. 1, system 100 includes a dimmer circuit 108 couple to an inputvoltage source Vin, a controller 110, and a transformer 114. Transformer114 has a primary winding 122, a secondary winding 124, and one or moreauxiliary windings 126. Auxiliary winding 126 provides power supply VCCto controller 110 through diode 103 Secondary winding 124 provides anoutput voltage Vout and an output current Io to LED lamp 117 through arectifying circuit including a diode 115 and a capacitor 116. Thecurrent sense (CS) terminal of controller 110 receives informationregarding primary current flowing through power switch 101 through acurrent sense signal from current sense resistor 111. In FIG. 1, dimmercircuit 108 is used to vary the input line voltage to adjust thebrightness of LED lamp 117.

As shown in FIG. 1, controller 110 is coupled to dimmer circuit 108through a low-pass filter including resistors 105 and 106 and capacitor107, to receive a signal DIM from dimmer circuit 108. Dimmer circuit 108is used to vary the magnitude of input voltage Vin to vary the output tothe LED lamp. In some embodiments, dimmer circuit 108 can be aconventional dimmer circuit that receives direct manual control or awireless control signal. In response to the DIM signal, controller 110,which is coupled to power switch 101, is configured to adjust theaverage current in the secondary winding and provide a steady outputcurrent Io to the output. Dimmer circuit 108 is coupled to power factorcorrection module (PFC) 109 and primary winding 122 of transformer 114.When the OUT terminal of controller 110 is at a high voltage, primaryside power switch 101 is turned on, the peak primary current isconverted to a voltage signal to the CS terminal of controller 110 bycurrent sense resistor 111. When the signal at the CS terminal reaches areference level in the controller, a driver circuit is shut off, thecontrol signal at the OUT terminal of controller 110 is closed, turningoff power switch 101.

The FB terminal of controller 110 receives a feedback signal formauxiliary winding 126 that represents the output voltage Vout at thesecondary winding. Based on the FB signal, controller 110 generates asignal Tons that indicates the conduction time of the secondary current.Controller 110 uses on-time signal Tons to control internal charging anddischarging times of a capacitor, which in turn control the on time, orduty cycle, of control signal at the OUT terminal for regulating theoutput of the power supply.

As used herein, “Tsw” represents the period of voltage supply to LEDlamp 117. In embodiments of the present invention, controller 110 isconfigured to adjust the ratio Tons/Tsw according to the variation ofthe DIM signal, which is related to the output of the dimmer circuit. Inthe primary-side control configuration shown in FIG. 1, output currentIo can be derived from the following equations.

${{Ipk} = \frac{Vcs}{Rcs}};$ Ipks = N * Ipk;${{Io} = {{\frac{Tons}{2*{Tsw}}*{Ipks}} = \frac{N*{Tons}*{Vcs}}{2*{Tsw}*{Rcs}}}};$

where

Ipk is the peak primary current,

Ipks is the peak secondary current,

Vcs is a reference voltage for a peak current comparator,

Rcs is the current sensing resistor, and

N is the ratio of coil turns of the primary winding and secondarywinding.

As shown in the above equation, output current Io is proportional to theration Tons/Tsw. In embodiments of the invention, controller 110 adjustsoutput current Io by varying Tons/Tsw and reference voltage Vcs. Thecurrent provided to LED lamp, Io, can be adjusted in a wide range. Asdescribed above, the DIM signal used in controlling Io is an averageoutput voltage from dimmer 108. There is no need to determine the typeof dimmer circuit and which portion of the input voltage cycle isremoved by the dimmer circuit. Therefore, the methods described hereinare compatible with different types of dimmer circuits.

FIG. 2 is a simplified diagram illustrating a functional block diagramof controller 110 in the lighting system of FIG. 1 according to anembodiment of the present invention. As shown in FIG. 2, controller 110has terminals VCC, FB, DMI, OUT, and GND, whose functions are describedbelow. Controller 110 receives power from terminal VCC. At start-up, VCCis charged up to a start-up voltage sufficient for internal power andbias voltages. Controller 110 also receives feedback signal at the FBterminal. Based on the feedback signal, which reflects the outputvoltage, controller 110 produces a Tons signal according to theconduction time of the secondary side rectifying circuit. Controller 110is configured to use the Tons signal to adjust an internal charging anddischarging current ratio and control the on time in the next controlcycle. As described below in connection with Dimming Block 210,controller 110 is also configured to adjust the ratio Tons/Tsw accordingto the signal DIM.

When the current sense signal at the CS terminal reaches a pre-setcurrent turn off reference voltage, controller 110 generate a PEAK_CTRLsignal to turn off pulse control signal PFM. The driver circuit isturned off, which causes the control signal at the OUT terminal to turnoff.

FIG. 3 is a simplified diagram illustrating a portion of the controllerfor dimmer control according to an embodiment of the present invention.Dimming Block 300 in FIG. 3 is an exemplary embodiment of Dimming Block210 in FIG. 2. The DIM terminal of controller 110 as shown in FIGS. 1and 2 receives a DC voltage signal provided by a dimmer circuit througha low-pass filter. Controller 110 uses the DIM signal to determine theoutput current. As shown in FIG. 3, the DIM signal enters Dimmer Block300 through a voltage follower 301, which produces a Vdim signal. TheVdim signal is coupled a substractor 330, which includes first resistor304, second resistor 305, third resistor 306, and operational amplifier303. The output of Substractor 330, Vdmin_in, can be expressed by thefollowing equation.

Through amplifier 308, the Vdim_in signal is converted to a voltagesignal at resistor 310, which is reflected as current I2 through a firstcurrent mirror including transistors 311 and 312. Dimming Block 300 alsoincludes a reference voltage VREF1 which, through amplifier 321,resistor 320, and a second current mirror including transistor 315, 316,317, and 318, produces three current signals, I1_1, I1_2, and I1_3.

Dimming Block 300 also includes a Max current selector 313, which iscoupled to current signals I2, I1_1, and I1_2, provides two outputsignals Iout1 and Iout2. Iout1 is coupled to a constant current (CC)Loop Controller 314, which outputs signal CC_CTRL used in Controller 110for charging and discharging a capacitor to produce a constant current(CC) control signal. As shown in FIG. 2, Iout2 is used by Controller 110in controlling the peak current in the primary winding.

As shown in FIG. 3, Max current selector 313 also receives an EN signalfrom comparator 302, when the DIM signal is greater than a referencevoltage VREF_dim. The EN signal forces Iout1 and Iout2 to be zero and,as a result, I1_3 becomes the only non-zero input the CC Loop Controller314. Under this condition, the maximum output current can be controlledby a reference voltage and hence be maintained accurately.

FIG. 4 is a simplified circuit diagram illustrating a maximum currentselector circuit 313 in FIG. 3 according to an embodiment of the presentinvention. As described above in connection with FIG. 3, Max currentselector 313 has three inputs: I2, I1_1, and I1_2. In some embodiments,I1_1 and I1_2 are equal. Max current selector 313 also has two outputs,Iout1 and Iout2. As described below, the values of Iout1 and Iout2 aredetermined by the values of inputs I2, I1_1, and I1_2.

As shown in FIG. 4, I1_1 and I2 are coupled through a current mirrorincluding transistor 401, 402, 403, and 404. When I2 is less than I1_1,current I3=I1_1−I2. At this time, transistor 405 is turned on, andtransistor 406 is turned off. I4=I1_2−I3=I1_2−(I1_1−I2)=I2. On the otherhand, when I2 is greater than I1_1, I3=I2−I1_1. Transistor 405 is turnedoff, and transistor 406 is turned on. As a result, I4=I1_2.

In FIG. 4, current I4 is coupled to output Iout1 through a currentmirror that includes transistors 410, 411, 412, 413, 414, and 415.Current I4 is also coupled to output Iout2 through a current mirror thatincludes transistor 416, 417, 418, and 419. By properly selecting thetransistor ratios in the current mirrors, outputs Iout1 and Iout2 can bemade to vary with I2, when I2 is less than I1_1. On the other hand, whenI2 is greater than I1_1, outputs Iout1 and Iout2 determined by I1_1,which is a fixed reference signal in this example. As described above,the maximum values for Iout1 and Iout2 are limited by the greater of I2and I1_1.

FIG. 5 is a simplified circuit diagram illustrating an example ofconstant-current control circuit 314 in FIG. 3 according to anembodiment of the present invention. As described above in connectionwith FIG. 3, constant-current control circuit 314 receives two inputsignals: I1_3 and Iout1. As shown in FIG. 5, reference current I1_3 isprovided to a current mirror, including transistors 511, 512, 513, and514, which outputs a current Ich2. Further, current I1_3 is alsomirrored to a current Idis2 through current mirror circuits oftransistors 515, 516, 517, 518, 519, and 520. Similarly, Iout1, throughcurrent mirrors, including transistors 501, 502, 503, 504, 505, and 506,is mirrored into Ich2 and Idis1.

As shown in FIG. 5, constant-current control circuit 314 produces aconstant-current control signal CC_CTRL, which is the output of acomparator 526 that compares the voltage at capacitor 525 with areference voltage VREF3. Capacitor 526 is charged by a charging currentIchar when a first switch is turned on by signal Tons_N, and dischargedby a discharging current Idischar when a second switch is turned on bysignal Tons. As described above, Tons indicates secondary sideconduction. As shown in FIG. 2, Tons indicates is generated by theTonsec Detector block 340 which receives CC_CTRL, and Tons_N iscomplementary to Tons.

As shown in FIG. 5, charging current Ichar is derived from Ich3 througha current mirror, including transistors 507, 507, 509, and 510, with

Ich3=Ich2−Ich1.

Similarly, discharging current Idischar is derived from Idis3 through acurrent mirror 521, 522, 523, and 524, with

Idis3=Idis1+Idis2.

Therefore, TONS can be controlled by the CC_CTRL signal, which in turncan be varied by currents I2, I1_1, I1_2, and I1_3. As shown in FIG. 3,these current components are controlled by the DIM signal.

In a specific embodiment, with properly selected current mirrortransistors,

Ichar=Ich3=Ich2−Ich1=Iout1−I1_(—)3

Idischar=Idis3=Idis1+Idis2=I1_(—)3+Iout1, and

Ichar/Idischar=(Iout1−I1_(—)3)/(Iout1+I1_(—)3)

It can be seen that the ratio of charging current to discharging currentcan be expressed as a difference between two quantities Iout1 and I1_3and the sum of those two quantities, where Iout1 is related to a varyinginput signal and I1_3 is an internal reference signal. By properlyselecting the reference signal, the ratio Ichar/Idischar can be made tovary over a wide range. For example, by setting I1_3 less than butapproximately equal to the minimum value of Ichar, the minimum value ofthe ratio Ichar/Idischar can be made arbitrarily small. As describedbelow, this wide range of Ichar/Idischar can be used to vary the dutycycle of current flow in the transformer and provide a wide range ofoutput current control.

As described above, the high level of control signal TONS coincide withthe discharging of capacitor 525, and the low level of TONS coincideswith the charging of capacitor 525. Depending on the output of thedimmer circuit, the DIM voltage varies. In FIG. 3, when voltage signalDIM decreases, Vdim_in rises. As a result 12 increases. As a result, theoutputs of Max current selector 313 also increase. It follows that thecharging current increases, and the discharging current decreases. Byvarying the ratio of charging and discharging currents, the pulse widthof CC_CNTL can be controlled. In constant-current mode, controller 110produces an output signal OUT with a duty cycle determined by CC_CNTL.This duty cycle, in turn, determines the magnitude of the outputcurrent.

An example of controlling LED driving circuit with a dimmer can bedescribed with reference to FIG. 3. In an embodiment, the output rangeof the dimmer circuit is 0-3V, and Vref_dim is set at 3.1V.

-   -   If the DIM voltage is greater than Vref_dim, the Iout1 and Iout2        from Max current selector 313 are both 0. In this embodiment,        the current mirror transistors in FIG. 5 are chosen such that        Ich2=6 uA, Ich1=0 uA, Idis1=0 uA, and Idis2=4.5 uA. With        Ich3=Ich2−Ich1 and Idis3=Idis1+Idis2, the ratio of charging and        discharging currents becomes: Ich/Idis=6/4.5. Thus,        Tons/Tsw=1/dis/(1/Idis+1/Ich)=4/7. Under this condition, the        peak voltage comparator voltage is at a maximum, 0.5V.    -   On the other hand, if the DIM voltage is 0, Ich2=6 uA, Ich1=5        uA, Idis1=15 uA, and Idis2=4.5 uA. The ratio of charging and        discharging currents becomes: Ich/Idis=1/19.5. Thus,        Tons/Tsw=1/dis/(1/Idis+1/Ich)=1/20.5. Under this condition, the        peak voltage comparator voltage is at a minimum, 0.14V.

If the transformer coil turn ratio is 5, and peak current sensingresistor is 1.25 ohms, from equation:

${Io} = \frac{N*{Vcs}*{Tons}}{2*{Tsw}*{Rcs}}$

we can get maximum output current Iomax=0.571 A, minimum output currentIomin=0.0136 A, and Iomin/Iomax=2.38%. It can be seen that with thevariation of the DIM voltage, the adjustable output current can varybetween the maximum output current and about 2% of the maximum outputcurrent. In other embodiments, with different circuit parameters,different ratios of charging and discharging currents can be obtained.The adjustable output range can be extended to 1% of the maximum output.

FIG. 6 is a simplified flow chart illustrating a method for driving anLED lamp with a dimmer circuit according to an embodiment of the presentinvention. As shown in FIG. 6, the method includes the following steps:

-   -   S100—receiving an average output voltage DIM from a dimmer        circuit which is configured to adjustR an input line voltage;    -   S200—varying signals TONS and Tsw to adjust average output        current; and    -   S300—driving an LED lamp with the average output current.        The method can be implemented using the circuits described above        in connections with FIGS. 1-5.

As described above, embodiments of the invention provide circuits andmethods for adjusting driving current to an LED lamp based on the outputvoltage of a dimmer that varies the input line voltage. In someembodiments, the dimmer output voltage is converted to current to varythe on-off duty cycle of a power switch. In a specific embodiment, aconstant-current mode switch mode controller determines the duty cycleof the control signal by charging and discharging a capacitor. With adimmer circuit for varying the input line voltage, the duty cycle isadjusted by adjusting the charging and discharging currents with theaverage output of the dimmer circuit. The method provides a wide rangeof LED driving current and is compatible with different types andspecific functions of dimmer circuit. Thus, the LED driving capabilityis improved and energy loss is reduced.

In the above description, specific circuits and examples are used toillustrate the embodiments, it is understood that the examples andembodiments described herein are for illustrative purposes only and thatvarious modifications or changes in light thereof will be suggested topersons skilled in the art and are to be included within the spirit andpurview of this invention.

What is claimed is:
 1. A control circuit for providing a pulsed controlsignal, the control circuit comprises: an input terminal for receivingan input voltage; an output terminal for providing a pulsed controlsignal; a capacitor; and a comparator; wherein the pulsed control signalis characterized by a duty cycle that is determined by a chargingcurrent and a discharging current coupled to the capacitor, the chargingcurrent and the discharging current being related to the input voltage.2. The control circuit of claim 1 wherein the charging current isdetermined by a difference between a first signal and a second signal,and the discharging current is determined by a sum of the first signaland the second signal, wherein the first signal is derived from theinput voltage, and the second signal is derived from a first referencesignal.
 3. The control circuit of claim 2 further comprising: a firstPMOS current mirror coupled to the first signal; a first NMOS currentmirror coupled to the second signal, a first output of the first NMOScurrent mirror coupled to a first output of the first PMOS currentmirror for providing the difference between the first signal and thesecond signal; a second PMOS current mirror coupled to a second outputof the first NMOS current mirror, an output of the second PMOS currentmirror coupled to a second output of the first PMOS current mirror forproducing the sum of the first signal and the second signal.
 4. Thecontrol circuit of claim 2 wherein the duty cycle of the pulsed controlsignal is determined by (I1−I2)/(I1+I2), wherein I1 represents the firstsignal and I2 represents the second signal.
 5. A system for driving anLED (light-emitting diode) lamp, comprising: a dimmer circuit coupled toa line input voltage for varying a magnitude of an input voltage; atransformer having a primary winding, a secondary winding, and one ormore auxiliary windings, the primary winding coupled to the dimmercircuit; an output rectifying circuit coupled to the secondary windingfor providing an output current to the LED lamp; a power switch coupledto the primary winding for controlling a current flow in the primarywinding; a controller having a comparator and a capacitor, for providinga control signal to control the power switch for regulating the outputcurrent, the controller coupled to the dimmer circuit for receiving anaverage input voltage signal from the dimmer circuit, wherein thecontrol signal is characterized by a duty cycle that is determined by aratio of a charging current to a discharging current coupled to thecapacitor, the ratio being related to the average input voltage signalfrom the dimmer circuit.
 6. The system of claim 5 wherein the chargingcurrent is determined by a difference between a first signal and asecond signal, and the discharging current is determined by a sum of athird signal and a fourth signal, wherein the first signal and the thirdsignal are derived from the average input voltage signal, and the secondsignal and the fourth signal are derived from a first reference signal.7. The system of claim 6 wherein the first signal is derived from theaverage input voltage signal through a first current mirror, the thirdsignal is derived from the average input voltage signal through a secondcurrent mirror, the second signal is derived from the first referencesignal through a third current mirror, and the fourth signal is derivedfrom the first reference signal through a fourth current mirror.
 8. Thesystem of claim 7 wherein the charging current is derived from a fifthcurrent mirror coupled a first node coupled to the first signal and thesecond signal, and the discharging current is derived from a sixthcurrent mirror connected to the third signal and the fourth signal. 9.The system of claim 8 wherein each of the first, the second, and thefifth current mirrors comprises PMOS transistors.
 10. The system ofclaim 8 wherein each of the third, the fourth, and the sixth currentmirrors comprises NMOS transistors.
 11. The system of claim 5 whereinthe charging current is determined by a difference between a firstsignal and a second signal, and the discharging current is determined bya sum of the first signal and the second signal, wherein the firstsignal is derived from the average input voltage signal, and the secondsignal is derived from a first reference signal.
 12. The system of claim11 wherein a minimum output current provided to the LED lamp is about 2%of a maximum output current.
 13. The system of claim 5 wherein thecontroller further comprises: a voltage follower for receiving theaverage input voltage signal; a substractor coupled to the voltagefollower; a first current mirror coupled to the substractor, a currentselector configured for receive a current from the first current mirror;and a second current mirror configured to receive a first referencevoltage and to provide three reference currents, two of the referencecurrents being coupled to the current selector, wherein the currentselector are configured to provide two output signals, a first outputsignal coupled to a peak current comparator, a second output signalcoupled to a constant-current control circuit for adjusting the ratio ofcharging and discharging current.
 14. A driver circuit for an LED(light-emitting diode) lamp, comprising: a transformer having a primarywinding, a secondary winding, and one or more auxiliary windings; adimmer circuit coupled to a power source and the primary winding; anoutput rectifying circuit coupled to the secondary winding for providingan output current to the LED lamp; a controller coupled to the dimmercircuit to receive an average input voltage from the dimmer circuit(DIM), the controller being configured to vary the output currentaccording to the average output voltage.
 15. The driver circuit of claim14 wherein the controller is configured to provide an output current Iocharacterized by the following equations: ${{Ipk} = \frac{Vcs}{Rcs}};$Ipks = N * Ipk;${{Io} = {{\frac{Tons}{2*{Tsw}}*{Ipks}} = \frac{N*{Tons}*{Vcs}}{2*{Tsw}*{Rcs}}}};$wherein Ipk is the peak primary current, Ipks is the peak secondarycurrent, Vcs is a reference voltage in the controller; Rcs is aresistance of the peak current detection, N is the turn ratio betweenthe primary winding and secondary winding.
 16. The driver circuit ofclaim 14 wherein the controller includes a current control module, thecurrent control module comprising: a voltage follower for receiving theDIM signal; a substractor coupled to the voltage follower; a firstcurrent mirror coupled to the substractor, a current selector configuredto receive a current from the first current mirror; a second currentmirror configured to receive a first reference voltage and to providethree reference currents, two of the reference currents being coupled tothe current selector, wherein the current selector are configured toprovide two output signals, a first output signal coupled to a peakcurrent comparator, a second output signal coupled to a constant-currentcontrol circuit for adjusting a ratio of charging and discharging. 17.The driver circuit of claim 16 wherein the substractor comprises: afirst resistor, a second resistor, a third resistor, and an operationalamplifier, the substractor configured to produce a Vdim_in signalcauterized by:${V\; {dim\_ in}} = {{{VREF}\; 2*\left( {1 + \frac{R\; 305}{R\; 304}} \right)} - {\frac{R\; 305}{R\; 304}*V\; \dim}}$wherein Vdim is the voltage at the DIM terminal.
 18. The driver circuitof claim 16 wherein the maximum current selector comprises three currentmirrors and is configured received three input currents I1, I2, and I3,with I2=I3, wherein: If I1>I2, then the output current=I2, and If I1<I2,then the output current=I1.
 19. The driver circuit of claim 16 wherein,when the DIM signal is greater than a reference signal, the outputcurrent of the maximum current selector is set to zero.